import React, { Component } from 'react';
import queryString from 'query-string'
import axios from 'axios';
import Item from '../component/Item'
class Index extends Component {
    constructor(props){
        super(props);
        this.state={
            movie:[]
        }
    }
    render() {
        return (
            <div>
                <Item data={this.state.movie}></Item>
            </div>
        );
    }
    componentDidMount(){
        var {id}=queryString.parse(window.location.search);
        axios.get(`http://122.112.161.135:4000/api/movieDetail?id=${id}`).then(res=>{
            console.log(res);
            this.setState({
                movie:res.data.res
            })
        })
    }
}

export default Index;
